<?php
/**
 * View_Contract
 *
 * Класс View_Contract отвечает за вывод информации, связанной с договорами
 *
 */
class View_Contract extends View_Base {

	public function showAddForm() {
		Service_Debug::setDebug();
		$objForm = new Form_ViewForm(array(
				'errorIfExists' => true,
				'id' => 'contract-form',
				'leftWidth' => 200,
				'viewFormType' => 'table'
		), new Contract);
		$objForm->show();
		$objForm->textField(array('maxlength' => '64', 'class' => 'mandatory', 'text' => 'Имя'), 'first_name');
		$objForm->textField(array('maxlength' => '64', 'class' => 'mandatory', 'text' => 'Фамилия'), 'last_name');
		$objForm->textField(array('maxlength' => '64', 'class' => 'mandatory', 'text' => 'Отчество'), 'middle_name');
		
		$objCity = new City();
		$arrCities = $objCity->getArrCities();
		$objForm->selectField(array('text' => 'Город','valueName' => 'city_name','keyName' => 'city','optionsArray' =>$arrCities),'city');
		$objForm->textField(array('maxlength' => '512', 'class' => 'mandatory', 'text' => 'Название работы',), 'contract_name');
		$objForm->textareaField(array('text' => 'Описание работ', 'class' => 'mandatory'), 'contract_description');
		
		$objForm->textField(array('maxlength' => '3', 'text' => 'Сроки', 'class' => 'mandatory number'), 'deadline');
		$objForm->submitButton(array('value' => 'Отправить'), 'save');
		$objForm->close();
	}
}
?>